<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page import="java.util.*"%>
<%@ page import="org.apache.commons.fileupload.*"%>
<%@ page import="com.gzgi.framework.sys.util.*"%>
<%
            String actionType = request.getParameter("actionType");
			if("upload".equals(actionType)){
				DiskFileUpload fu = new DiskFileUpload();   
				fu.setSizeMax(1024000); 
				fu.setSizeThreshold(8192); 
 				List fileItems = fu.parseRequest(request);  
				Iterator iter = fileItems.iterator();   
				 while (iter.hasNext()) {   
					FileItem fileItem = (FileItem) iter.next();   
					String filename = fileItem.getName();// 获得文件名，这个文件名包括路径：   
					if (filename != null && filename.endsWith(".xls")) {   
                        UserImport.importUser(fileItem.getInputStream());
					    out.println("处理成功！");
					    return;
					}
				 }
			}
%>

<SCRIPT LANGUAGE="JavaScript">
   function submitForm(){
	     document.iForm.submit();
   }
</SCRIPT>
<form id="iForm" name="iForm" method="post"
	enctype="multipart/form-data" action="?actionType=upload"><input
	type="file" name="file"> <INPUT type="button" name="button"
	value=" 确定 " onclick="javascript:submitForm();">&nbsp;&nbsp;</form>